-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Bug cov nat #60898
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Bug cov nat #60898
Conversation
fbourgey
commented
Feb 9, 2025
- closes BUG: cov buggy when having NaT in column #53115
@jbrockmendel, @WillAyd, could you please take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm - @jbrockmendel anything else on your end?
@jbrockmendel, I made the updates |
pandas/core/frame.py
Outdated
dtypes = [blk.dtype for blk in self._mgr.blocks] | ||
if any(d.kind in "mM" for d in dtypes): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dtypes = [blk.dtype for blk in self._mgr.blocks] | |
if any(d.kind in "mM" for d in dtypes): | |
if any(blk.dtype.kind in "mM" for blk in self._mgr.blocks): |
], | ||
} | ||
) | ||
arr = np.array( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arr = np.array( | |
expected = np.array( |
[np.nan, 8.64e04, 2.00e00], | ||
] | ||
) | ||
assert np.allclose(df.to_numpy(float, na_value=np.nan), arr, equal_nan=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert np.allclose(df.to_numpy(float, na_value=np.nan), arr, equal_nan=True) | |
result = df.to_numpy(float, na_value=np.nan), | |
tm.assert_numpy_array_equal(result, expected) |
Co-authored-by: Matthew Roeschke <[email protected]>
Co-authored-by: Matthew Roeschke <[email protected]>
Co-authored-by: Matthew Roeschke <[email protected]>